<style>

</style>
<template>

</template>
<script>
    Rap.define('', '', function () {
        var table_column_id = 0;
        return {
            name: 'ly-collection-column',
            props: {
                label: {
                    'defalut': ''
                },
                align: {
                    'default': 'left'
                },
                width: {
                    'default': 0
                },
                flex: {
                    'default': null
                },
                name: String
            },
            data: function () {
                table_column_id++;
                return {
                    table_column_id: table_column_id
                }
            },
            computed: {
                owner: function () {
                    var parent = this.$parent;
                    while (parent && !parent.tableId) {
                        parent = parent.$parent;
                    }
                    return parent;
                }
            }, mounted: function () {
                var column = {
                    name: this.name,
                    width: this.width,
                    flex: this.flex,
                    label: this.label,
                    align: this.align,
                    contentRender: this.$scopedSlots.default
                };
               this.owner.addColumn(column);
            }
            , render: function (h) {
                return h('span', {'class': 'ly-table-column-hidden'}, this.$slots.default);
            }
        }
    });
</script>
